package com.zzyl.common.ai;

import com.baidubce.qianfan.Qianfan;
import com.baidubce.qianfan.core.auth.Auth;
import com.baidubce.qianfan.model.chat.ChatResponse;

public class AIModelTest {

    public static void main(String[] args) {
        ChatResponse response = new Qianfan(Auth.TYPE_IAM,"ALTAKRXKjT6PTHdXtIg6OuJiEs","1d6cf83d391149b499339891d1b952a2").chatCompletion()
                .model("ERNIE-4.0-8K-Preview")
                .addMessage("user", "")
                .temperature(0.7)
                .maxOutputTokens(2000)
                .responseFormat("json_object")
                .execute(); // 发起请求
        System.out.println(response.getResult());
    }
}
